import 'package:url_launcher/url_launcher_string.dart';

/// APP 相关链接
abstract class AppLinks {
  /// 服务协议
  static const terms = 'https://exping.world/terms';

  /// 隐私政策
  static const privacy = 'https://exping.world/privacy';

  /// 社区公约
  static const communityGuideline = 'https://exping.world/community-guide';

  /// 版本记录
  static const changelog = 'https://support.exping.world/changelog';

  /// 反馈
  static const feedback = 'https://support.exping.world/feedback';

  /// Instagram
  static const instagram = 'https://www.instagram.com/exping.world/';

  static Future<bool> openTerms() {
    return launchUrlString(terms).onError((error, stackTrace) => false);
  }

  static Future<bool> openPrivacy() {
    return launchUrlString(privacy).onError((error, stackTrace) => false);
  }

  static Future<bool> openCommunityGuideline() {
    return launchUrlString(communityGuideline)
        .onError((error, stackTrace) => false);
  }

  static Future<bool> openFeedback() {
    return launchUrlString(feedback).onError((error, stackTrace) => false);
  }
}
